package com.yjt.common.base.datasource;
public class DBContextHolder{  
	
    public static final String YJTMNG_SESSION_FACTORY = "yjtmngSessionFactory";  
    public static final String GDDW_SESSION_FACTORY = "gddwSessionFactory";  
    public static final String YJTROUTING_SESSION_FACTORY = "yjtroutingSessionFactory";  
      
    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();  
    
    /**
     * 在Controller层切换数据源
     * @param dbType
     */
    public static void setDBType(String dbType) {  
        contextHolder.set(dbType);  
    }  
      
    public static String getDBType() {  
        return contextHolder.get();  
    }  
      
    public static void clearDBType() {  
        contextHolder.remove();  
    }  
} 